#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int A[1001];
void solve(int n, int k) {
	memset(A, 0, sizeof(A));
	int i, j;
	for (i = 1; i <= k; i++)
		for (j = 1; j <= n; j++)
			if (j % i == 0)
				A[j] = ~A[j];
	for (i = 1; i <= n; i++)
		if (A[i])
			printf("%d ", i);
}
int main(void) {
	int n, k;
	scanf("%d%d", &n, &k);
	solve(n, k);
	return EXIT_SUCCESS;
}
